﻿namespace HZY.Core.ApplicationServices;

/// <summary>
/// 后台系统基础控制器
/// </summary>
[ApiResultFilter]
// [Route("api/[controller]/[action]")]
// [Authorize] //是否授权 Authorize
[ApiController]
public abstract class ApplicationControllerBase(IServiceProvider serviceProvider) : ControllerBase, IAopServiceProvider
{
    public IServiceProvider ServiceProvider { get; set; } = serviceProvider;
}

/// <summary>
/// 后台系统基础控制器
/// </summary>
/// <typeparam name="TService"></typeparam>
public abstract class ApplicationControllerBase<TService>(IServiceProvider serviceProvider)
    : ApplicationControllerBase(serviceProvider) where TService : class
{
    /// <summary>
    /// 默认服务
    /// </summary>
    [Autowired]
    protected TService Service { get; } = null!;
}